<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
request.setAttribute("basePath", basePath);

String outpatientAppointmentInfoJson= (String)request.getAttribute("outpatientAppointmentInfoJson");
String success= (String)request.getAttribute("success");
%>
<link href="${basePath}/static/css/Pigeonhole/Pigeonhole_list.css"
	rel="stylesheet" type="text/css">
<link rel="stylesheet"
	href="${basePath}/static/css/medicalRecord_Search/medicalSearch.css" />
<script type="text/javascript"
	src="${basePath}/static/publics/assets/jqPaginator/jqPaginator.js"></script>
	<script type="text/javascript" src="${basePath}assets/js/echarts.js"></script>
<div class="list_NR">
<div class="loc">
            <h3>全院门诊情况</h3>
            <ul class="loc_loc">1.8 门诊提前预约情况
            </ul>
        </div>
        
        <div class="list_con_table">
	        	<div class="search_table">
                <ul class="clearfix" style="margin-bottom:0;">
                		
                    <li class="Label_5">
                        <div class="right">
                        	<input class="btn" type="button" onclick="exportWord()" value="导出">
                        	<input class="btn" type="button" onclick="save()" value="保存">
                        </div>
                    </li>
                    <li class="Label_1" style="width:12%;height:400px;line-height:100px">说明：&nbsp;</li>
                    <li class="Label_2" style="width:17%;height:400px"><textarea style="height:400px;width:517%"/>${outpatientAppointmentInfo.note}</textarea></li>
                </ul>
            </div>
        </div>
       
        <table class="Search_tableList" cellpadding="0" cellspacing="0">
       		  <tr>
                <td class="tdLabel_5" colspan="10">
                	<div id="container2" style="height: 600px;width:100%"></div>
                </td>
     		 <tr>
             
            </tbody>
               
           
        </table>



</div>
	





<script>
var myChart;

function exportWord(){
	 var base64info = myChart.getDataURL();
	 $.ajax({
	  type:"post",
	  data:{image:base64info,method:'getImage'},
	  url:"${basePath}/report/exportOutpatientAppointment",
	  success:function(data){
	     window.location.href ="${basePath}/report/exportOutpatientAppointment?method=export";
	  }
	})
	 
	 }

//保存
function save(){
	 var base64info = myChart.getDataURL();
   $.ajax({
       type:"post",
       data:{img:base64info},
        url:"${basePath}/report/saveOutpatientAppointment",
        success:function(data){
        	layer.alert(data.msg,{icon:1});
        }
   });
	

}


//初始化图表信息
$(function(){
	var outpatientAppointmentInfoJson= <%=outpatientAppointmentInfoJson%>;
	
	console.log(outpatientAppointmentInfoJson);
	if(null!=outpatientAppointmentInfoJson){
		initCharset2(outpatientAppointmentInfoJson);
	}
	
});




function initCharset2(params){
	var dom = document.getElementById("container2");
	myChart = echarts.init(dom);
	var app = {};
	option = null;
	option = {
	    title: {
	        text: '预约方式构成比',
	        left: 'center'
	    },
	    tooltip: {
	        trigger: 'item',
	        formatter: '{a} <br/>{b} : {c} ({d}%)'
	    },
	    legend: {
	        orient: 'vertical',
	        left: 'left',
	        data: params.typeList
	    },
	    series: [
	        {
	        	name: '预约类型',
	            type: 'pie',
	            radius: '55%',
	            center: ['50%', '60%'],
	            data:params.paramList,
	           /*  data: [
	                {value: 335, name: '直接访问'},
	                {value: 310, name: '邮件营销'},
	                {value: 234, name: '联盟广告'},
	                {value: 135, name: '视频广告'},
	                {value: 1548, name: '搜索引擎'}
	            ], */
	            emphasis: {
	                itemStyle: {
	                    shadowBlur: 10,
	                    shadowOffsetX: 0,
	                    shadowColor: 'rgba(0, 0, 0, 0.5)'
	                }
	            }
	        }
	    ]
	};
	;
	if (option && typeof option === "object") {
	    myChart.setOption(option, true);
	}
}





</script>